home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48_2
/
displst
< prev
next >
Wrap
Text File
|
1995-03-31
|
6KB
|
169 lines
On first getting the Equation Library card for the HP48SX I was
naturally elated, but then a little disappointed to find that it
didn't have exactly the equations that I needed for my work. I
therefore set out to write them in by somehow emulating the Equation
library card. I found that the most difficult part for me was
implementing the scrolling/hilited menu system of the 48. The
program DISPLIST and associated routines do just that. DISPLIST
takes any list argument from the stack and displays it 6 elements at
a time, enabling you to scroll through it, highlighting the elements
one by one. If you press ENTER the program will exit, leaving the
number of the list element that is high-lighted on the stack.
Pressing QUIT (the 6th softkey) will exit the program, leaving zero
on the stack. The other 3 softkeys toggle between SI, ENG and no
units like the equation library card does.To change the title that
appears, change the text in the routine TITLE (32 chars max).
I'm sure there's a better way to do this in machine code, but this
will have to do for now. By using the HP supplied "USERLIB.EXE"
(available from HP's BBS or from the NOZONE-?) you can compile your
routines into a library, like the equation library, and use
"msolve",etc. Enjoy.
Jim Weisbin [693]
31 Langton Street
London SW10 0JH
071-537-5320 (days)
-----------------CUT HERE ----------------------------------------
%%HP: T(3)A(D)F(.);
DIR
DISPLIST
\<< DUP SIZE DUP 6 @ a is the list @
MIN 1 1 \-> a s t c d @ s is the size @
\<< 64 CF TITLE a c @ t is minimum of s or 6 @
LISTOGR d HILITE @ c is list counter @
DO MNU1 TMENU @ d is display counter @
-1 WAIT IP \-> x @ mnu1 sets up soft menu @
\<< @ start main loop @
CASE { 33 @ left or up arrow scroll up @
25 } x POS
THEN d
HILITE 'd' DECR 'c' @ call HILITE routine @
DECR DROP2
CASE c
1 < d 1 < AND
THEN
s DUP 'c' STO 1 + t
- t 'd' STO s 6
IF >
THEN a SWAP LISTOGR @ redisplay list (call LISTOGR) @
ELSE DROP
END
END c
1 < d 1 \>= AND
THEN
s 'c' STO
END c
1 \>= d 1 < AND
THEN
1 'd' STO s 6
IF >
THEN a c LISTOGR @ redisplay list (call LISTOGR)@
END
END
END d
HILITE @ call HILITE routine @
END { 35 @ right or dn arrow scroll dn @
36 } x POS
THEN d
HILITE 'c' INCR 'd' @ call HILITE routine @
INCR DROP2
CASE c
s > d t > AND
THEN
1 'c' STO 1 'd' STO
s 6
IF >
THEN a c LISTOGR @ redisplay list if s > 6 @
END
END c
s > d t \<= AND
THEN
1 'c' STO
END c
s \<= d t > AND
THEN
c 1 + t - t 'd' STO
s 6
IF >
THEN a SWAP LISTOGR @ redisplay list if s > 6 @
ELSE DROP
END
END
END d
HILITE @ call HILITE routine @
END x 11 @ 1st soft key (sets SI
== @ units by setting flag 60) @
THEN 60
CF
END x 12 @ 2nd sost key (sets ENG @
==
THEN 60 @ units by clearing flag 60) @
SF
END x 13 @ 3rd soft key sets units on/off @
== @ (toggles flag 61) @
THEN 61
DUP
IF FS?
THEN CF
ELSE SF
END
END 16 x @ 6th soft key quits and leaves @
== @ zero on the stack @
THEN 0
DUP 'x' STO 2 MENU
END x 51 @ enter key quits and leaves @
== @ number of list which is HILITEd @
THEN 0 @ on the stack for future use @
'x' STO c
END
END x
\>>
UNTIL 0 == @ exit loop when zero on stack @
END
\>> 2 MENU @ user menu (VAR) @
\>>
HILITE
\<< PICT
GROB 131 9 @ this is a solid black stripe @
@ 9 pixels high @ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70
ROT 1 - 8 * 7 + R\->B
# 0d SWAP 2 \->LIST
SWAP GXOR
\>>
LISTOGR
\<< 8 \-> a n c @ routine to get max 6 list @
\<< a n 1 a SIZE 6 @ elements from starting @
MIN @ number n and convert them @
START GETI \->STR 2 @ to a GROB @
\->GROB # 131d # 9d @ a is the list @
BLANK { # 0d # 0d } @ n is start number @
ROT GOR PICT SWAP @ c is counter (starts at 8) @
# 2d c R\->B 'c' 8
STO+ 2 \->LIST SWAP
REPL
NEXT DROP2
\>>
\>>
MNU1
\<< 60
IF FC? @ routine to set up units menu @
THEN "SI " "ENG" @ a la equation library card @
ELSE "SI" "ENG " @ use chr 258 for " " @
END 61
IF FS?
THEN "UNITS"
ELSE "UNIT "
END " " " "
"QUIT" 6 \->LIST
\>>
TITLE
\<< CLLCD LCD\-> { # 0d
# 0d } @ routine to title display @
"YOUR TITLE HERE" 2 @ insert your title here @
\->GROB REPL PICT STO
{ # 0d # 0d } PVIEW
\>>
END